<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>全部佣金</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
.arrow{
	width: 1rem;
}
.down:after{
	content: '';
	position: absolute;
	top:1rem;
	/*right:1.4rem;*/
	border-left: 6px solid transparent;
	border-top: 6px solid #9B9B9B;
	border-bottom: 6px solid transparent;
	border-right: 6px solid transparent;
}
.up::after{
	content: '';
	position: absolute;
	top:0.7rem;
	border-left: 6px solid transparent;
	border-top: 6px solid transparent;
	border-bottom: 6px solid #9B9B9B;
	border-right: 6px solid transparent;
}
#header .aui-title {
	left: 0;
	right: 0;
    color: #333;
    font-size: 0.85rem;
    padding-right: 0.5rem;
		width: 50%;
		margin: 0 auto;
}
</style>
</head>

<body>
		<header class="aui-bar aui-bar-nav aui-bar-light" id="header">
					<div class="aui-pull-left back" tapmode onclick="api.closeWin()"></div>
					<div class="aui-title aui-flex-col aui-flex-center" tapmode onclick="toggleFrame('jiangli_mask')">
						<span id="title">全部佣金</span>
						<div class="arrow down"></div>
					</div>
					<div class="aui-pull-right" tapmode onclick="openWin()"></div>
			</header>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var title;
var index;
apiready = function() {
    api.parseTapmode();
		var header = $api.byId('header');
    $api.fixStatusBar(header);
    var headerH = $api.offset(header).h;
		if(api.pageParam.text){
			$$('#title').text(api.pageParam.text);
		}
		title = $$('#title').text();
		console.log(title)
		api.addEventListener({
		    name: 'maskListEvent'
		}, function(ret, err){
			$$('.arrow').addClass('down').removeClass('up');
		    if( ret.value.text ){
				title =	$$('#title').text(ret.value.text);
		    }else{
					$$('.arrow').addClass('up').removeClass('down');
		    }
		});
    api.openFrame({
        name: 'full_commission_frm',
        url: 'full_commission_frm.html',
        rect: {
            x: 0,
            y: headerH,
            w: 'auto',
            h: 'auto'
        },
				bounces: false,
        pageParam: api.pageParam
    });

	api.addEventListener({
	    name: 'closeFrameEvent'
	}, function(ret, err){
	    if( ret ){
	         $$('.arrow').addClass('down').removeClass('up');
	    }else{
	        //  alert( JSON.stringify( err ) );
	    }
	});


};
// 切换frame
function toggleFrame(jiangli_mask) {
	var headerH = $api.offset(header).h;
	if(!$api.getStorage('jiangli_mask')){ // 指定的framename_未打开
		api.openFrame({
			name: jiangli_mask,
			url: jiangli_mask+'.html',
			rect:{
				x: 0,
				y: headerH,
				w: api.winWidth,
				h: api.winHeight
			},
			bounces: false,
		});
		api.parseTapmode();
		$$('.arrow').addClass('up').removeClass('down');
		$api.setStorage('jiangli_mask', true);
	}else { // 指定的framename_已打开

		api.closeFrame({
			name: 'jiangli_mask'
		});
		$$('.arrow').addClass('down').removeClass('up');
		$api.rmStorage(jiangli_mask);
	}
}
</script>
</html>
